<?php


header('Content-Type: image/png');
$escaped_command = escapeshellcmd("/usr/local/bin/convert <(/usr/local/bin/convert <(/usr/local/bin/convert pattern.png <(/usr/local/bin/convert red.png -blur 0x3 -auto-level png:-) -alpha set -virtual-pixel transparent -compose displace -set option:compose:args -20x20 -composite png:-) red.png -compose multiply -composite png:-) blue.png green.png orange.png purple.png yellow.png -compose screen -background none -flatten -compose over png:-");

system($escaped_command);

//print_r($run);

/*
$data = base64_decode($data);

$im = imagecreatefromstring($data);
if ($im !== false) {
    header('Content-Type: image/png');
    imagepng($im);
    imagedestroy($im);
}
else {
    echo 'An error occurred.';
}

exec("/usr/local/bin/convert <(/usr/local/bin/convert <(/usr/local/bin/convert pattern.png <(/usr/local/bin/convert red.png -blur 0x3 -auto-level png:-) -alpha set -virtual-pixel transparent -compose displace -set option:compose:args -20x20 -composite png:-) red.png -compose multiply -composite png:-) blue.png green.png orange.png purple.png yellow.png -compose screen -background none -flatten -compose over hasil.png",$out, $err);

*/
?>
